]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
app-system: Remove lookup_app_for_path
authorJasper St. Pierre <jstpierre@mecheye.net>
Sat, 20 Apr 2013 21:23:37 +0000 (17:23 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Sun, 3 Nov 2013 00:12:37 +0000 (20:12 -0400)
It's absurdly silly. Just modify the one place that uses it
to be better.

https://bugzilla.gnome.org/show_bug.cgi?id=698486

src/shell-app-system.c
src/shell-app-system.h
src/shell-window-tracker.c

index 5efcce46ee6bdcf3cb32b0b9450936efc0575d0b..f508efb0127a20ff20217919f2078af4933e3f72 100644 (file)
@@ -296,42 +296,6 @@ shell_app_system_lookup_app (ShellAppSystem   *self,
   return g_hash_table_lookup (self->priv->id_to_app, id);
 }
 
-/**
- * shell_app_system_lookup_app_for_path:
- * @system: a #ShellAppSystem
- * @desktop_path: (type utf8): UTF-8 encoded absolute file name
- *
- * Find or create a #ShellApp corresponding to a given absolute file
- * name which must be in the standard paths (XDG_DATA_DIRS).  For
- * files outside the datadirs, this function returns %NULL.
- *
- * Return value: (transfer none): The #ShellApp for id, or %NULL if none
- */
-ShellApp *
-shell_app_system_lookup_app_for_path (ShellAppSystem   *system,
-                                      const char       *desktop_path)
-{
-  const char *basename;
-  const char *app_path;
-  ShellApp *app;
-
-  basename = g_strrstr (desktop_path, "/");
-  if (basename)
-    basename += 1;
-  else
-    basename = desktop_path;
-
-  app = shell_app_system_lookup_app (system, basename);
-  if (!app)
-    return NULL;
-
-  app_path = g_desktop_app_info_get_filename (shell_app_get_app_info (app));
-  if (strcmp (desktop_path, app_path) != 0)
-    return NULL;
-
-  return app;
-}
-
 /**
  * shell_app_system_lookup_heuristic_basename:
  * @system: a #ShellAppSystem
index 2fc294c8b98e9ee59672203812600b05b2937468..1eb15e9e8c600c2ab6671e90a3297860d3ba6715 100644 (file)
@@ -41,8 +41,6 @@ ShellAppSystem *shell_app_system_get_default (void);
 
 ShellApp       *shell_app_system_lookup_app                   (ShellAppSystem  *system,
                                                                const char      *id);
-ShellApp       *shell_app_system_lookup_app_for_path          (ShellAppSystem  *system,
-                                                               const char      *desktop_path);
 ShellApp       *shell_app_system_lookup_heuristic_basename    (ShellAppSystem  *system,
                                                                const char      *id);
 
index ed9d9b43cd9fbd0664b9292453fd4bccde53d39e..e1d563f3cdc2c53252cad2e98d7e9b543b1818ad 100644 (file)
@@ -844,6 +844,7 @@ ShellApp *
 shell_startup_sequence_get_app (ShellStartupSequence *sequence)
 {
   const char *appid;
+  char *basename;
   ShellAppSystem *appsys;
   ShellApp *app;
 
@@ -851,8 +852,10 @@ shell_startup_sequence_get_app (ShellStartupSequence *sequence)
   if (!appid)
     return NULL;
 
+  basename = g_path_get_basename (appid);
   appsys = shell_app_system_get_default ();
-  app = shell_app_system_lookup_app_for_path (appsys, appid);
+  app = shell_app_system_lookup_app (appsys, basename);
+  g_free (basename);
   return app;
 }